<template>
  <div v-if="info">
    <el-row type="flex" class="option" v-if="info.id">
      <el-col :span="3">区域：</el-col>
      <el-col :span="24">
        <div class="scenics-box" v-if="info.scenics.length>0" :class="{scenicsbox1:isshow}">
          <span v-for="(item,index) in info.scenics" :key="index">{{item.name}}</span>
        </div>
        <a href="javascript:;" @click="isshow = !isshow">
          <i class="el-icon-d-arrow-right" :class="[{tran:!isshow},{trans:isshow}]"></i>
          <i>等{{info.scenics.langth}}个区域</i>
        </a>
      </el-col>
    </el-row>
    <el-row type="flex" class="option">
      <el-col :span="3">
        均价
        <sup class="question-mark el-tooltip" aria-describedby="el-tooltip-1527" tabindex="0">?</sup>：
      </el-col>
      <el-col :span="24">
        <el-row type="flex">
          <el-col :span="6">
            <span aria-describedby="el-tooltip-9886" tabindex="0">
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <span class="price-budget">¥332</span>
            </span>
          </el-col>
          <el-col :span="6">
            <span aria-describedby="el-tooltip-5465" tabindex="0">
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <span class="price-budget">¥521</span>
            </span>
          </el-col>
          <el-col :span="6">
            <span aria-describedby="el-tooltip-3801" tabindex="0">
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <i class="iconfont iconhuangguan"></i>
              <span class="price-budget">¥768</span>
            </span>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      info: [],
      isshow: false
    };
  },
  methods: {
    SelectAreaResult() {
      this.$axios({
        url: "/cities",
        params: {
          // name:'广州'
          name: this.$route.query.city
        }
      }).then(res => {
        console.log(res.data);
        this.info = res.data.data[0];
        console.log(this.info);
      });
    }
  },
  watch: {
    $route: {
      handler() {
        this.SelectAreaResult();
      },
      immediate: true
    }
  }
  // created() {
  //   this.SelectAreaResult()
  // }
};
</script>

<style lang="less" scoped>
.option {
  margin-bottom: 20px;
  color: #666;
  font-size: 14px;
  .scenics-box {
    height: 40px;
    overflow: hidden;
    span {
      margin-right: 15px;
      padding: 0 2px;
      border-radius: 4px;
      display: inline-block;
      cursor: pointer;
    }
  }
  .scenicsbox1 {
    height: 80px;
  }
  .trans {
    transform: rotate(-90deg);
  }
  .tran {
    transform: rotate(90deg);
  }
  .el-icon-d-arrow-right {
    color: #f90;
  }
  .question-mark {
    background-color: #ccc;
    color: #fff;
    display: inline-block;
    width: 14px;
    height: 14px;
    text-align: center;
    border-radius: 100%;
  }
}
.price-budget {
  margin-left: 7px;
}
.iconhuangguan {
  margin-right: -6px;
  color: #f90;
}
</style>